package com.company.笔试.整数求和;

import java.util.Scanner;

/**
 * @author ylr
 * @version 1.0.0
 * @ClassName Main.java
 * @Description TODO
 * @createTime 2021年10月21日 20:25:00
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        String[] str = s.split(" ");
        int n = Integer.valueOf(str[0]);
        int m = Integer.valueOf(str[1]);
        int[] array  = new int[n+1];
        for (int i = 1; i <= n; i++) {
            array[i]=1;
        }
        array[0]=0;
        for (int i = 1; i <= n; i++) {
            int index = m-i;

            try {
                int left = array[index];
                if (left==0) {
                    System.out.println(i+" "+left);
                }
            }catch (Exception e) {
                continue;
            }
        }


    }
}
